package com.bwie.controller;
import com.bwie.pojo.User;
import com.bwie.service.MenuService;
import com.bwie.service.UserService;
import com.bwie.service.impl.UserServiceImpl;
import com.bwie.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* (t_user)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/user/index")
public class UserController {
/**
* 服务对象
*/
    @Autowired
    private UserService userService;

    @Autowired
    private MenuService menuService;

    @ApiOperation("登录")
    @PostMapping("userLogin")
    public R userLogin(@RequestBody @Validated User user){
        return userService.userLogin(user);
    }

    @ApiOperation("用户权限")
    @PostMapping("getTree")
    public R getTree(){
        return menuService.getTree();
    }
}
